package com.core.family.gen.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;

import java.util.Map;
import java.util.Objects;

/**
 * @author hl
 * @version 1.0.0
 * @ClassName GenProperties.java
 * @Description 类描述
 * @createTime 2023年05月05日 15:50:00
 */
@Data
@Component
@ConfigurationProperties(prefix = "gencode.conf")
public class GenProperties {

    private String active = "mysql";

    private Map<String, DatasourceProperties> ds;

    private BaseProperties genCof;


    @Data
    public static class DatasourceProperties {
        private String driverClassName;
        private String url;
        private String userName; //用户名
        private String password;  //密码
    }


    @Data
    public static class BaseProperties {
        private String javaSubPath = "\\src\\main\\java\\";
        private String baseDirPath = "D:\\gen";

        /*工程基础路径*/
        private String diskPath = baseDirPath + javaSubPath;
        private String packageName = "com.core.family.admin";
        private String author = "honglei";
        private boolean autoRemovePre = true; //是否自动去除前缀
        private String tablePrefix = "rcp_";
        private String sqlType = "mysql";


        //    实体
        private int selectModel = 1;
        //    dao层
        private int selectDao = 1;
        //    xmlMapper映射
        private int selectXml = 1;
        //    service层
        private int selectService = 1;
        //    service实现层
        private int selectServiceImpl = 1;
        //    Controller层
        private int selectController = 1;
        //    web层
        private int selectWeb = 1;
    }


}
